<#include "/includes/vars.inc"> 
<#include "/includes/embed_macro.inc"> 
<@pp.dropOutputFile />
<#list entities.entity as entity>
    <@pp.changeOutputFile name="${webDir}/jeecode/"+entity.@name?uncap_first+"/include/"+entity.@name?cap_first+"DataView.xhtml" />
    <#assign entityName = entity.@name>
    <#assign managedBean = entity.@name?uncap_first+"Controller">
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">
     
    <ui:composition>
    <#list entity["many-to-one"] as rel>
    	<h:outputLabel value="${r"#{"}msg.${entityName?uncap_first}${rel.@name?cap_first}${r"}"}:" />
        <h:outputText value="${r"#{"}${managedBean}.current.${rel.@name?uncap_first}${r"}"}"/>
        
    </#list>
    <#list entity["one-to-one"] as rel>
    	<h:outputLabel value="${r"#{"}msg.${entityName?uncap_first}${rel.@name?cap_first}${r"}"}:" />
        <h:outputText value="${r"#{"}${managedBean}.current.${rel.@name?uncap_first}${r"}"}"/>
        
    </#list>
    <#list entity.column as column>
        <#if column.@primary="false">
            <#if column.@type = "Date" >
        <h:outputLabel value="${r"#{"}msg.${entityName?uncap_first}${column.@name?cap_first}${r"}"}:" />
        <h:outputText value="${r"#{"}${managedBean}.current.${column.@name?uncap_first}${r"}"}">
            <f:convertDateTime pattern="${config.date.@pattern}" timeZone="${r"#{"}utilController.timeZone}" />
        </h:outputText>
        	<#elseif (column.@type ="Integer") || (column.@type ="Double") || (column.@type ="Float")>
       			<#if column.@numType="CURRENCY">
        <h:outputLabel value="${r"#{"}msg.${entityName?uncap_first}${column.@name?cap_first}${r"}"}:" />
        <h:outputText value="${r"#{"}${managedBean}.current.${column.@name}${r"}"}">
            <f:convertNumber type="currency" maxFractionDigits="2" />
        </h:outputText>
        		<#elseif column.@numType="PERCENT">
        <h:outputLabel value="${r"#{"}msg.${entityName?uncap_first}${column.@name?cap_first}${r"}"}:" />
        <h:outputText value="${r"#{"}${managedBean}.current.${column.@name}${r"}"}%" />
        		<#else>
        <h:outputLabel value="${r"#{"}msg.${entityName?uncap_first}${column.@name?cap_first}${r"}"}:" />
        <h:outputText value="${r"#{"}${managedBean}.current.${column.@name}${r"}"}">
            <f:convertNumber type="number" minFractionDigits="0" maxFractionDigits="2" />
        </h:outputText>
        		</#if>
            <#elseif column.@type?cap_first = "Boolean">
        <h:outputLabel value="${r"#{"}msg.${entityName?uncap_first}${column.@name?cap_first}${r"}"}:" />        
        <h:selectBooleanCheckbox  disabled="true" value="${r"#{"}${managedBean}.current.${column.@name}${r"}"}" />
        	<#elseif embeddables.embeddable.@name?seq_contains(column.@type)>
        <@resolveEmbedView entityName="${entityName}" embedName="${column.@type}" columnName="${column.@name}" />
            <#else>
        <h:outputLabel value="${r"#{"}msg.${entityName?uncap_first}${column.@name?cap_first}${r"}"}:" />
        <h:outputText value="${r"#{"}${managedBean}.current.${column.@name?uncap_first}${r"}"}"/>
            </#if>
        </#if>
        
    </#list>
    </ui:composition>
</html>

</#list>